import request from '@/utils/request'

export function getInfo(token) {
  return request({
    url: '/vue-admin-template/user/info',
    method: 'get',
    params: { token }
  })
}

export function logout() {
  return request({
    url: '/vue-admin-template/user/logout',
    method: 'post'
  })
}

// 封装登录请求接口
export const login = data => request.post('/sys/login', data)

// 获得用户资料接口
export const userInfoRequest = () => request.post('/sys/profile')

// 获得用户详细信息接口
export const getUserDetailById = id => request.get(`/sys/user/${id}`)

// 给员工分配角色 /sys/user/assignRoles
export const userAssignRolesRequest = data => request.put('/sys/user/assignRoles', data)

